﻿package plugin.specialActivity.game
{
    import com.core.*;
    import manager.*;
    import morn.core.handlers.*;
    import plugin.specialActivity.*;
    import plugin.taskdialog.consts.*;
    import uiresource.specialActivity.*;

    public class ShuangBeiGame extends ShuangbeiUI implements IPage
    {
        private var _pageMsg:Object;
        private var endTime:int = 0;

        public function ShuangBeiGame(param1:Object)
        {
            this._pageMsg = param1;
            this.initEvent();
            return;
        }// end function

        private function initEvent() : void
        {
            btn_guaji.clickHandler = new Handler(this.doGuaJi);
            return;
        }// end function

        private function doGuaJi() : void
        {
            var _loc_1:Object = null;
            if (UserData.getUserData("level") >= 49)
            {
                _loc_1 = ConfigDictionary.data.sysnpc[81];
                ModelProxy.change("data", "taskfindpath", _loc_1.npcid);
                ModelProxy.change("zone", "stopGuaji", null);
                PluginManager.instance.sendToServer("taskdialog", CMDTaskdialog.Fly, {x:_loc_1.x, y:_loc_1.y, tostageid:_loc_1.stageid});
            }
            else
            {
                WarningManager.show(38, [49]);
            }
            return;
        }// end function

        public function refresh() : void
        {
            return;
        }// end function

        public function update(param1:int, param2:Object) : void
        {
            switch(param1)
            {
                case ActivityPublic.UPDATETIME:
                {
                    txt_countdown.text = String(param2);
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

    }
}
